import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin:sessionStorage.getItem('isLogin') || false,
    Types:[],
    tid:null,
    userid:sessionStorage.getItem('uid'),
    shopcart:[],
  },
  mutations: {
    getLogin(state,isLogin){
      state.isLogin=isLogin
    },
    getType(state,type){
      // console.log(type,'啦啦啦啦');
      state.Types=type
    },
    getTid(state,tid){
      // console.log(id);
      state.tid=tid
    },
    getUserId(state,uid){
      state.userid=uid
    },
    getShopcart(state,shopcar){
      state.shopcart=shopcar
    },
  },
  actions: {
  },
  modules: {
  }
})
